<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/favicon.ico">
    <link rel="icon" type="image/png" href="./assets/img/favicon.ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>Anchor Bootstrap 4.1.3 UI Kit by WowThemesNet</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport'/>

    <!-- Google Font -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:300,300i,400,600,800" rel="stylesheet">

    <!-- Font Awesome Icons -->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

    <!-- Main CSS -->
    <link href="./assets/css/main.css" rel="stylesheet"/>

    <!-- Animation CSS -->
    <link href="./assets/css/vendor/aos.css" rel="stylesheet"/>

</head>

<body>

<!------------------------------------------
NAVBAR:不用改
------------------------------------------->

<!------------------------------------------
HEADER
------------------------------------------->
<div class="jumbotron jumbotron-lg jumbotron-fluid mb-3 bg-primary position-relative">
    <div class="container text-white h-100 tofront">
        <div class="row align-items-center justify-content-center text-center">
            <div class="col-md-10">
                <!-- thymeleaf语法:渲染文章题目 -->
                <h1>VMware克隆CentOS7.X网卡修改为静态IP与分布式</h1>
            </div>
        </div>
    </div>
</div>



<div class="container  pt-5 pb-5" data-aos="fade-up">
    <div class="row justify-content-center">
        <div class="col-md-8 mt-20">
            <article>
                <!-- 此处渲染标题 -->
                <h1><strong>Bold title</strong> for your paragraph</h1>
<!--                <p th:text="${article.content}">Welcome to BeiJing!</p>-->
                <tbody>
                    <td><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;">在虚拟机vmware中往往克隆一个新的系统后，要去修改静态ip，直接使用的话可能会不尽如人意，ip也是需要管理起来的。</p><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;">在这里以Centos 7.x 为例，centos6.x的网卡静态ip方式可以搜我以前的博客（cnblog）。</p><ol style="padding-left: 40px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: decimal;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">查看网卡信息</p><pre style="margin-bottom: 0px; white-space: pre-wrap;"><code class="language-text">ip link show
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610546-1101045216.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 788px;"><br>ens33 是我的网卡名称，每个人的都不一样，有的也叫eth0，另外一个红框就是你的网卡地址了。把这个网卡地址复制下俩，临时保存：<code>00:0c:29:c8:49:60</code>。</p></li><li style="list-style-type: decimal;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">执行如下命令，修改网卡地址：</p><pre style="margin-bottom: 0px; white-space: pre-wrap;"><code class="language-text">vim /etc/udev/rules.d/70-persistent-ipoib.rules
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610481-1879297238.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 790px;"><br>把注释打开，再把<code>ATTR{address}</code>修改为你的网卡地址<code>00:0c:29:c8:49:60</code>，修改后如下图：<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610466-1323929994.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 795px;"></p></li><li style="list-style-type: decimal;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">修改ip信息：</p><pre style="margin-bottom: 0px; white-space: pre-wrap;"><code class="language-text">vim /etc/sysconfig/network-scripts/ifcfg-ens33
</code></pre><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">如下图，把IPADDR修改为你所想要的内网静态ip（需要注意，要和你的网段一致），然后还有一个<code>HWADDR</code>如果没有，则新增一个，然后再把之前的网卡地址加上，即可。<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610475-1415043294.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 531px;"></p></li><li style="list-style-type: decimal;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">这是最后一步，目前的ip并没有发生更改，还是克隆之前的ip<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610536-1254578151.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 715px;">需要重启电脑或者刷新网络，直接了当就reboot就行。。。</p><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">ooOoOoOo 等等启动 oOoOoOoo</p></li><li style="list-style-type: decimal;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">启动完毕，测试连接</p><ul style="list-style: none; margin-right: 0px; margin-left: 30px; padding: 0px;"><li style="list-style-type: disc;">填入你的ip，以及端口号还有用户名&nbsp;<img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610653-1911805189.jpg" alt="" style="height: auto; max-width: 100%; width: 616px;"></li><li style="list-style-type: disc;">设置你的会话名称：&nbsp;<img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610654-1701116130.jpg" alt="" style="height: auto; max-width: 100%; width: 616px;"></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">双击这个会话：</p><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;"><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610486-612127044.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 392px;"></p></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">输入密码：默认都是root<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610650-121800341.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 404px;"></p></li><li style="list-style-type: disc;"><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px;">进入后，可以看到ip已经OK了<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610714-1379928223.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 973px;"></p></li></ul></li></ol><h3 id="toc_0" style="font-size: 16px; font-weight: bold; line-height: 1.5; margin-top: 10px; margin-right: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-family: 微软雅黑, 宋体, Arial;">Tips</h3><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;">内网的网络，虚拟机使用桥接，如果你在公司和家里都是相同网段的话，只是有线无线的区别，那么可以采用自动检测即可。<br><img src="https://img2018.cnblogs.com/blog/841496/202003/841496-20200308123610555-302466791.jpg" alt="" style="height: auto; max-width: 100%; margin: 10px; width: 640px;"></p><h3 id="toc_1" style="font-size: 16px; font-weight: bold; line-height: 1.5; margin-top: 10px; margin-right: 0px; margin-left: 0px; color: rgb(0, 0, 0); font-family: 微软雅黑, 宋体, Arial;">关于内网互通原则</h3><p style="margin-top: 10px; margin-right: auto; margin-left: auto; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;">很多小伙伴都在看我的课程，由于分布式环境，那么一定要保证内网互动，不互通那么会请求不了，比如请求图片服务器，搭建lvsIP漂移等</p><ul style="list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding: 0px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px;"><li style="list-style-type: disc;">内网互通原则：<ul style="list-style: none; margin-right: 0px; margin-left: 30px; padding: 0px;"><li style="list-style-type: circle;">1. 虚拟机中linux与本地都要关闭防火墙，设置静态ip（注意不要网络冲突）</li><li style="list-style-type: circle;">2. 文件服务器（即虚拟机要和本地电脑互通）</li><li style="list-style-type: circle;">3. 所有计算机节点的网段保证一致，比如 192.168.1.xxx，172.10.10.xxx</li><li style="list-style-type: circle;">4. 手机和你的电脑要在同一个网络，同一个wifi，网段要检查是否一致</li><li style="list-style-type: circle;">5. 客户端请求的serverUrl一定要写你电脑的内网IP，如果写localhost，那么手机是请求不了的</li><li style="list-style-type: circle;">6. 主机ping虚拟机，虚拟机ping主机，都要保证OK</li><li style="list-style-type: circle;">注意: 如果你的电脑使用的校内网络，可能会导致无法访问</li></ul></li></ul></td>
                </tbody>
            </article>
        </div>
    </div>
</div>
<!-- End Main -->
<!--------------------------------------
JAVASCRIPTS:不用改
--------------------------------------->
<!-- CDN 引入vue 和 axios -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="./assets/js/vendor/jquery.min.js" type="text/javascript"></script>
<script src="./assets/js/vendor/popper.min.js" type="text/javascript"></script>
<script src="./assets/js/vendor/bootstrap.min.js" type="text/javascript"></script>
<script src="./assets/js/functions.js" type="text/javascript"></script>

<!-- Animation -->
<script src="./assets/js/vendor/aos.js" type="text/javascript"></script>
<noscript>
    <style>
        *[data-aos] {
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
        }
    </style>
</noscript>
<script>
    AOS.init({
        duration: 700
    });
</script>

<script type="module">
    import { onMounted, ref } from 'vue'
    import request from '@/utils/request.js'
    defineProps({
        data: {
            type: Array,
            required: true
        }
    })
    //获取数据
    const blogs = ref([])
    const getData = async () => {
        let res = await request({
            url: '/article/2/1',
            method: 'GET'
            //data: { content: '好' }
        })
        console.log('res:', res)
        blogs.value = res.rows
        console.log('blogs', blogs)
    }

    onMounted(() => {
        getData(),
            console.log("'blogs', blogs")
    })
</script>

<!-- Disable animation on less than 1200px, change value if you like -->
<script>
    AOS.init({
        disable: function () {
            var maxWidth = 1200;
            return window.innerWidth < maxWidth;
        }
    });
    // $(document).ready(function () {
    //
    //     if(location.href.indexOf("#reloaded")==-1){
    //         location.href=location.href+"#reloaded";
    //         location.reload();
    //     }
    // })
    if (location.href.indexOf("#reloaded") == -1) {
        location.href = location.href + "#reloaded";
        location.reload();
    };
</script>

</body>
</html>